module.exports = {
    filter: function (list, err, cnt = 0) {
        if (err) {
            return {
                "error_code": 20000,
                "error_msg": err
            };
        } else if (list.err !== undefined) {
            return {
                "error_code": 20000,
                "error_msg": list.err
            };
        }
        else {
            return {
                "error_code": 0,
                "data": {
                    list: list,
                    cnt: cnt
                }
            };
        }
    },
    isset: function (obj, attr = [], emptyVerify = false) {
        for (let i in attr) {
            if (!(attr[i] in obj)) {
                return false
            }
        }
        if(emptyVerify){

        }
        return true;
    }
};
